home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Networking / OT PAPServerSample / PAPPostScriptStuff.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.1 KB  |  92 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        PAPPostScriptStuff.h
  3.  
  4.     Contains:    Header file for the PAPPostScriptStuff.c code file
  5.  
  6.     Written by:     
  7.  
  8.     Copyright:    Copyright © 1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/22/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24.  
  25. #ifndef __PAPPOSTSCRIPTSTUFF__
  26. #define __PAPPOSTSCRIPTSTUFF__
  27.  
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41. #define kQueryPrefix    0x0D25253F
  42. #define kBeginQueryStr    "Query\015"
  43. #define kQueryStr        "Query: "
  44. #define kBeginStr        "Begin"
  45. #define kEndStr            "\015\045\045\077End"
  46. #define kEOFStr            "\015\045\045EOF\015"
  47. #define kReturnChar        0x0D
  48. #define kLineFeedChar    0x0A
  49. #define kSpaceChar        0x20
  50.  
  51. enum {
  52.     kCaseMustMatch = 0,
  53.     kCaseMatchAll
  54. };
  55.  
  56. enum {
  57.     kNoMatch = 0,
  58.     kPartialMatch         = 0x0001,
  59.     kQueryPrefixFound     = 0x0002,
  60.     kBeginEndStrFound     = 0x0004,
  61.     kQueryStrFound         = 0x0008,
  62.     kMatch                 = 0x000E
  63. };
  64.  
  65. enum {
  66.     kFindBeginStr = 0,
  67.     kFindEndStr
  68. };
  69.  
  70. // prototypes
  71. extern Boolean         TestDataIsPSQuery(PacketPtr packetPtr);
  72. extern OSStatus     ProcessPSQuery(PacketPtr packetPtr);
  73. extern Boolean         DoProcessPSQuery(PacketPtr    packetPtr);
  74. extern Boolean         IsPacketAPSQuery(PacketPtr packetPtr);
  75. extern UInt16        FindQueryString(PacketPtr packetPtr, SInt16 whichStr);
  76. extern UInt16        ProcessDefaultResponse(PacketPtr packetPtr);
  77. extern void         SendEmptyPacket(PacketPtr packetPtr);
  78.  
  79. #if PRAGMA_IMPORT_SUPPORTED
  80. #pragma import off
  81. #endif
  82.  
  83. #if PRAGMA_ALIGN_SUPPORTED
  84. #pragma options align=reset
  85. #endif
  86.  
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90.  
  91. #endif /* __PAPPOSTSCRIPTSTUFF__ */
  92.